package com.example.myapplication73.bean;

import com.example.myapplication73.R;

import java.util.ArrayList;

public class GoodsInfo {
    public long rowid; // 行号
    public int sn; // 序号
    public String name; // 名称
    public String desc; // 描述
    public float price; // 价格
    public String thumb_path; // 小图的保存路径
    public String pic_path; // 大图的保存路径
    public int thumb; // 小图的资源编号
    public int pic; // 大图的资源编号

    public GoodsInfo() {
        rowid = 0L;
        sn = 0;
        name = "";
        desc = "";
        price = 0;
        thumb_path = "";
        pic_path = "";
        thumb = 0;
        pic = 0;
    }

    // 声明一个手机商品的名称数组
    private static String[] mNameArray = {
            "暗影精灵6", "小新 Pro 13", "MateBook X 2020款", "优雅X5-2021S5", "荣耀MagicBook Pro 2020款", "拯救者 Y7000P 2020","惠普星 14 2019"," 华硕灵耀14"
    };
    // 声明一个手机商品的描述数组
    private static String[] mDescArray = {
            "惠普 暗影精灵6 i7 10750H/16GB/512GB/RTX2060/144Hz",
            "联想 小新 Pro 13 i5 10210U/8GB/512GB/集显",
            "华为 MateBook X 2020款 i5 10210U/16GB/512GB/集显",
            "神舟 优雅X5-2021S5 i5 集成显卡，IPS显示屏，背光键盘",
            "华为  荣耀MagicBook Pro 2020款 i7 10510U/16GB/512GB/MX350",
            "联想 拯救者 Y7000P 2020  i7 10750H/16GB/1TB/RTX2060",
            "惠普  星 14 2019 i7 1065G7/16GB/512GB+1TB/MX250/初恋粉",
            "华硕 灵耀14 i7 1065G7/16GB/512GB/核显"
    };
    // 声明一个手机商品的价格数组
    private static float[] mPriceArray = {8699, 5499, 15999, 4499, 6699, 9199,8468,6546};
    // 声明一个手机商品的小图数组
    private static int[] mThumbArray = {
            R.drawable.jingling_s, R.drawable.xiaoxin_s, R.drawable.mate,
            R.drawable.shenzhou_s, R.drawable.rongyao_s, R.drawable.y7000_s,
            R.drawable.xing_s, R.drawable.ling_s
    };
    // 声明一个手机商品的大图数组
    private static int[] mPicArray = {
            R.drawable.jingling, R.drawable.xiaoxin, R.drawable.matebook,
            R.drawable.shenzhou, R.drawable.rongyao, R.drawable.y7000,
            R.drawable.xing, R.drawable.ling
    };

    // 获取默认的手机信息列表
    public static ArrayList<GoodsInfo> getDefaultList() {
        ArrayList<GoodsInfo> goodsList = new ArrayList<GoodsInfo>();
        for (int i = 0; i < mNameArray.length; i++) {
            GoodsInfo info = new GoodsInfo();
            info.name = mNameArray[i];
            info.desc = mDescArray[i];
            info.price = mPriceArray[i];
            info.thumb = mThumbArray[i];
            info.pic = mPicArray[i];
            goodsList.add(info);
        }
        return goodsList;
    }
}
